package com.lzy.concertticket.controller;

import com.lzy.concertticket.aop.log.ApiLog;
import com.lzy.concertticket.model.R;
import com.lzy.concertticket.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileController {

    @Autowired
    private FileService fileService;

    //  上传图片
    @ApiLog(title = "上传图片")
    @RequestMapping("/uploadImage")
    public R uploadImage(@RequestParam("file") MultipartFile multipartFile) {
        String url = fileService.uploadImage(multipartFile);
        return R.success(url);
    }


}
